package com.itheima.app.cotroller;

import com.itheima.app.manager.MakeFriendManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class MakeFriendController {

    @Autowired
    private MakeFriendManager makeFriendManager;

    //推荐最佳
    @GetMapping("/tanhua/todayBest")
    public ResponseEntity findRecommendUser(){
        return makeFriendManager.findRecommendUser();
    }

    //推荐列表
    @GetMapping("/tanhua/recommendation")
    public ResponseEntity findRecommendUserList(
            @RequestParam(value = "page",defaultValue = "1") Integer pageNum,
            @RequestParam(value = "pagesize" ,defaultValue = "10") Integer pageSize){
        return makeFriendManager.findRecommendUserList(pageNum , pageSize);
    }

    //推荐用户详情
    @GetMapping("/tanhua/{userId}/personalInfo")
    public ResponseEntity findRecommendUserDetails(@PathVariable Long userId){
        return makeFriendManager.findRecommendUserDetails(userId);
    }

    //查询用户问题
    @GetMapping("/tanhua/strangerQuestions")
    public ResponseEntity findStrangerQuestion(@RequestParam("userId") Long strangerUserId){
        return makeFriendManager.findStrangerQuestion(strangerUserId);
    }

    //查询探花卡片
    @GetMapping("/tanhua/cards")
    public ResponseEntity findCard(){
        return makeFriendManager.findCard();
    }


}
